<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!--移动设备有限-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="bootstrap/css/bootstrap.css">
		<!--引入Jquery-->
		<script src="bootstrap/js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
		<title></title>
		<style type="text/css">
			body{
				background: url("../../assets/images/bg.jgp.jpeg");
				width: 100%;
				height: 100vh;
				background-repeat: no-repeat;
				background-size: 100% 100%;
			}
			td {
				text-align: center;
			}
			.container{
				margin-top: 100px;
				background-color: rgba(255, 255, 255, 0.64);
				width: 400px;
				border-radius: 5px;
				padding-top: 10px;
				padding-bottom: 20px;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<table class="table table-condensed table-bordered table-striped table-hover" style="width: 300px;margin: 0 auto;">
				<caption class="h1 text-center bg-info">管理员注册</caption>
				<tr class=" text-center">
					<td width="100px">真实姓名:</td>
					<td>
						<input type="text" class="form-control"/>
					</td>
				</tr>
				<tr class=" text-center">
					<td>用户名:</td>
					<td>
						<input type="text" id="name" class="form-control"/>
					</td>
				</tr>
				<tr class=" text-center">
					<td>密码:</td>
					<td>
						<input type="password" id="password" class="form-control"/>
					</td>
				</tr>
				<tr class=" text-center">
					<td>确认密码:</td>
					<td>
						<input type="password" id="password1" class="form-control"/>
					</td>
				</tr>
				<tr class=" text-center">
					<td>手机号码:</td>
					<td>
						<input type="text" id="tel" class="form-control"/>
					</td>
				</tr>
				<tr>
					<td colspan="2"><button class="btn btn-info" onclick="register();">注册</button>
						<button class="btn btn-info" onclick="reset()">重新输入</button>
					</td>
				</tr>
				</tr>
			</table>
			<script>
				function register() {
					localStorage.setItem("name","dsdasd");
					var user_info={};
					user_info['name']=$("#name").val();
					user_info['password']=$("#password").val();
					if($("#password").val()!=$("#password1").val()){
						alert("密码不一致");
						return;
					}
					if($("#password").val()==""){
						alert("请输入密码");
						return;
					}
					if($("#name").val()==""){
						alert("请输入名字");
						return;
					}
					if($("#tel").val()==""){
						alert("请输入电话号码");
						return;
					}
					localStorage.setItem(user_info['name'],JSON.stringify(user_info));
					alert("注册成功！返回登录！"+user_info["name"]);
					window.location.href="登录.html";
				}
				function reset() {
					$("#name").val("");
					$("#password").val("");
					$("#password1").val("");
					$("#tel").val("");
				}
			</script>
		</div>
	</body>
</html>

